#include "spiderTestApp.h"
#include "spiderApp.h"
#include "Moose.h"
#include "AppFactory.h"
#include "MooseSyntax.h"
#include "ModulesApp.h"

template <>
InputParameters
validParams<spiderTestApp>()
{
  InputParameters params = validParams<spiderApp>();
  return params;
}

spiderTestApp::spiderTestApp(InputParameters parameters) : MooseApp(parameters)
{
  Moose::registerObjects(_factory);
  ModulesApp::registerObjects(_factory);
  spiderApp::registerObjectDepends(_factory);
  spiderApp::registerObjects(_factory);

  Moose::associateSyntax(_syntax, _action_factory);
  ModulesApp::associateSyntax(_syntax, _action_factory);
  spiderApp::associateSyntaxDepends(_syntax, _action_factory);
  spiderApp::associateSyntax(_syntax, _action_factory);

  bool use_test_objs = getParam<bool>("allow_test_objects");
  if (use_test_objs)
  {
    spiderTestApp::registerObjects(_factory);
    spiderTestApp::associateSyntax(_syntax, _action_factory);
  }
}

spiderTestApp::~spiderTestApp() {}

void
spiderTestApp::registerApps()
{
  registerApp(spiderApp);
  registerApp(spiderTestApp);
}

void
spiderTestApp::registerObjects(Factory & /*factory*/)
{
  /* Uncomment Factory parameter and register your new test objects here! */
}

void
spiderTestApp::associateSyntax(Syntax & /*syntax*/, ActionFactory & /*action_factory*/)
{
  /* Uncomment Syntax and ActionFactory parameters and register your new test objects here! */
}

/***************************************************************************************************
 *********************** Dynamic Library Entry Points - DO NOT MODIFY ******************************
 **************************************************************************************************/
// External entry point for dynamic application loading
extern "C" void
spiderTestApp__registerApps()
{
  spiderTestApp::registerApps();
}

// External entry point for dynamic object registration
extern "C" void
spiderTestApp__registerObjects(Factory & factory)
{
  spiderTestApp::registerObjects(factory);
}

// External entry point for dynamic syntax association
extern "C" void
spiderTestApp__associateSyntax(Syntax & syntax, ActionFactory & action_factory)
{
  spiderTestApp::associateSyntax(syntax, action_factory);
}
